package cn.njyd.corejava.thread.myday01;


class StudyThread extends Thread{

    public StudyThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        int n=(int)Math.random()*100;
        if(n%2==0){
            System.out.println(Thread.currentThread().getName()+"正在看视频");
        }else{
            System.out.println(Thread.currentThread().getName()+"正在写代码");
        }
    }
}


public class MyThread02 {
    public static void main(String[] args) {
        for(int n=1;n<50;n++){
            new StudyThread("第"+n+"个同学").start();
        }
    }

}
